<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- react底层核心库 -->
    <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <!-- react操作DOM的核心库，类似于jquery -->
    <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <!-- 用于解析babel -->
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
    <div id = 'root1'></div>
    <script type="text/babel">
        function tick(){
            let time = new Date().toLocaleTimeString()
            var template = <div>
                    <h1>hello zjb</h1>
                    <p>现在是北京时间：{time}</p>
                </div>
            ReactDOM.render(template,document.getElementById('root1'))

        }
        // tick()
        //定时器
        setInterval(tick,1000)
    </script>
</body>
</html>